package com.joysw.ui;

import butterknife.ButterKnife;
import butterknife.InjectView;

import com.joysw.R;
import com.joysw.view.TitleBarView;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

/**   
 * @Title: LoginActivity.java 
 * @Package com.joysw.ui 
 * @Description: 登陆页面
 * @author LIMINGYAN  
 * @date 2015年3月28日 上午7:35:27 
 * @version V1.0   
 */
public class LoginActivity extends BaseActivity implements OnClickListener{
	private static final String TAG = "LoginActivity";
	
	@InjectView(R.id.login_btn)
	Button mLoginBtn;
	@InjectView(R.id.login_title_bar)
	TitleBarView mTitleBar;
	@InjectView(R.id.tv_forget_password)
	TextView mTvForgetPwd;
	
	
	@Override
	protected void onCreate(Bundle arg0) {
		// TODO Auto-generated method stub
		super.onCreate(arg0);
		setContentView(R.layout.activity_login);
		ButterKnife.inject(this);
		
		initView();
	}
	
	private void initView(){
		mTitleBar.setCommonTitle(View.VISIBLE, View.VISIBLE, View.GONE);
		mTitleBar.setBtnLeft(R.drawable.back, R.string.login_register);
		mTitleBar.setTitleText(R.string.login);
		
		mTitleBar.setBtnLeftOnclickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
				//finish();
			}
		});
		
		mLoginBtn.setOnClickListener(this);
		mTvForgetPwd.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch(v.getId()){
			case R.id.login_btn:
				startActivity(new Intent(LoginActivity.this, MainActivity.class));
				finish();
			break;
			case R.id.tv_forget_password:
				startActivity(new Intent(LoginActivity.this, ModifyPwdActivity.class));
			break;
		}
	}

	
}
